package com.summer.dynamicProxy;

public class RunTest {
	public static void main(String[] args) {
		try {
			
			OriginalObject oo = new OriginalObject();
			OriginalObject obj = CglibProxy.createCglibDynamicProxy(oo);
			OriginalInterface intera = new OriginalInterfaceImpl();
			OriginalInterface inter = CglibProxy.createCglibDynamicProxy(intera);
			obj.see();
//			inter.add();
//			
//			if(inter.getClass().getMethod("add").isAnnotationPresent(Test.class)){
//				System.out.println("is a");
//			}else{
//				System.out.println("is not a");
//			}
//			if(intera.getClass().getMethod("add").isAnnotationPresent(Test.class)){
//				System.out.println("is a");
//			}else{
//				System.out.println("is not a");
//			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
